<style>
    .el-row {
        background-color: #1844a8!important;
    }
    .cdcss {
        background-color: #1844a8!important;
    }
</style>
<div id="tj" style="margin-top: 5%;">
    <div style="display: flex;justify-content: center;width: 100%;">
        <div style="margin-top: 10px;margin-right: 100px;"><img src="./img/z.png"></div>
        <div style="font-size: 27px;">产品统计</div>
        <div style="margin-top: 10px;margin-left: 100px;"><img src="./img/y.png"></div>
    </div>
    <div style="height:50px;width: 100%;"></div>
    <div style="width: 80%;margin: auto;">
        <el-tabs type="border-card">
            <el-tab-pane label="上传下载统计-机构">
                <iframe src="/home/statistics/map" style="border: 0px;width: 100%;height: 600px;overflow: hidden;"></iframe>
            </el-tab-pane>
            <el-tab-pane label="下载统计-产品">
                <iframe src="/home/statistics/histogram" style="border: 0px;width: 100%;height: 600px;overflow: hidden;"></iframe>
            </el-tab-pane>
        </el-tabs>
    </div>

</div>
<div id="footer"></div>
<script type="text/javascript">
    new Vue({
        // 控制的标签容器
        el: '#tj',
        // 交互的数据
        data() {
            return {
                count: 0
            };
        },
        mounted() {
            //加载
            const loading = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(255, 255, 255, 0.7)'
            });
            this.footer();
            loading.close();
        },
        methods: {
            /**
             * 渲染底部
             */
            footer() {
                $('#footer').load("/home/footer");
            }
        }
    })

</script>
<script>
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    // prettier-ignore
    let dataAxis = ['点', '击', '柱', '子', '或', '者', '两', '指', '在', '触', '屏', '上', '滑', '动', '能', '够', '自', '动', '缩', '放'];
    // prettier-ignore
    let data = [220, 182, 191, 234, 290, 330, 310, 123, 442, 321, 90, 149, 210, 122, 133, 334, 198, 123, 125, 220];
    let yMax = 500;
    let dataShadow = [];
    for (let i = 0; i < data.length; i++) {
        dataShadow.push(yMax);
    }
    option = {
        title: {
            text: '特性示例：渐变色 阴影 点击缩放',
            subtext: 'Feature Sample: Gradient Color, Shadow, Click Zoom'
        },
        xAxis: {
            data: dataAxis,
            axisLabel: {
                inside: true,
                color: '#fff'
            },
            axisTick: {
                show: false
            },
            axisLine: {
                show: false
            },
            z: 10
        },
        yAxis: {
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLabel: {
                color: '#999'
            }
        },
        dataZoom: [
            {
                type: 'inside'
            }
        ],
        series: [
            {
                type: 'bar',
                showBackground: true,
                itemStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        { offset: 0, color: '#83bff6' },
                        { offset: 0.5, color: '#188df0' },
                        { offset: 1, color: '#188df0' }
                    ])
                },
                emphasis: {
                    itemStyle: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                            { offset: 0, color: '#2378f7' },
                            { offset: 0.7, color: '#2378f7' },
                            { offset: 1, color: '#83bff6' }
                        ])
                    }
                },
                data: data
            }
        ]
    };
    // Enable data zoom when user click bar.
    const zoomSize = 6;
    myChart.on('click', function (params) {
        //console.log(dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)]);
        myChart.dispatchAction({
            type: 'dataZoom',
            startValue: dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)],
            endValue:
                dataAxis[Math.min(params.dataIndex + zoomSize / 2, data.length - 1)]
        });
    });

    option && myChart.setOption(option);

</script>
<style>


</style>
